﻿public class Solution136
{
    public int SingleNumber(int[] nums)
    {



        HashSet<int> map = new HashSet<int>();
        for (int i = 0; i < nums.Length; i++)
        {

            if (!map.Contains(nums[i]))
            {
                map.Add(nums[i]);
            }
            else
            {
                map.Remove(nums[i]);

            }
        }
        int res = 0;
        foreach (int i in map)
        {

            res = i;
        }
        return res;

    }
}

class Program136
{






    static void Main136(string[] args)
    {



        int[] nums = [2, 2, 1];
        Solution136 solution = new Solution136();
      int res=  solution.SingleNumber(nums);
        Console.WriteLine(res);
    }
}